package cn.wanho.rvo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* @author jingxu
* @date 2022-8-5
 * 向前端返回的选择题的内容
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ExamChoose implements Comparable<ExamChoose>{
    /**
     * 试卷的选题id
     */
    private Long id;

    /**
     * 题序号
     */
    private Integer sort;

    /**
     * 选择题内容
     */
    private String content;


    /**
     * 是否单选
     */
    private Byte alone;

    /**
     * 分值
     */
    private Integer score;


    private static final long serialVersionUID = 1L;

   /**
   * @author jingxu
   * @date 2022-8-5
   *实现该接口，使得题目按照序号排序
   */
    @Override
    public int compareTo(ExamChoose o) {
        if (this.sort > o.sort) {
            return 1;
        }else {
            return -1;
        }
    }
}
